<?php use_helper('jQuery')?>

<div id="main_header" class="ui-widget-header ui-corner-all">
    <h3>Datos de la Sección: "<?php echo $section->getTitle() ?>"</h3>
</div>
<div id="main_content" class="ui-widget ui-widget-content ui-corner-all">
    <table>
        <?php if($sf_user->hasCredential('Editar sección')): ?>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <?php echo jq_link_to_remote(
                                '<span class="ui-button-icon-primary ui-icon ui-icon-pencil"></span>
                                <span class="ui-button-text">Editar</span>',
                            array(
                                'update' => 'main',
                                'url' => url_for('section_edit',$section),
                                'before'   => 'clearView();showLoaderMain();',
                                'complete' => 'hideLoader();',
                                'script'   => true
                            ), array(
                                'class' => 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary',
                                'title' => 'Editar'
                            ))?>
                    </td>
                </tr>
            </tfoot>
        <?php endif; ?>
        <tbody>
            <?php if($section->getIsSubsection()): ?>
            <tr>
                <th>Es subsección de:</th>
                <td>
                    <?php echo jq_link_to_remote($section->getParent()->getTitle(),
                            array(
                                'update' => 'main',
                                'url'    => url_for('section_show',$section->getParent()),
                                'before'   => 'clearView();showLoaderMain();',
                                'complete' => 'hideLoader();',
                                'script'   => true
                            ),array(
                                'title' => 'Ir a la sección: "'.$section->getParent()->getTitle().'"'
                            ))?>
                </td>
            </tr>
            <?php endif;?>
            <tr>
                <th><label>Tipo:</label></th>
                <td><?php echo $section->getType() ?></td>
            </tr>
            <tr>
                <th><label>Con header:</label></th>
                <td>
                    <?php if($section->getUsesHeader()): ?>
                        <img alt="Sí" src="/images/util/check.png"/>
                    <?php else: ?>
                        <img alt="No" src="/images/util/cross.png"/>
                    <?php endif; ?>
                </td>
            </tr>
            <tr>
                <th><label>Con footer:</label></th>
                <td>
                    <?php if($section->getUsesFooter()): ?>
                        <img alt="Sí" src="/images/util/check.png"/>
                    <?php else: ?>
                        <img alt="No" src="/images/util/cross.png"/>
                    <?php endif; ?>
                </td>
            </tr>
            <tr>
                <th>Tipo de contenido:</th>
                <td><?php echo $section->getGallerySection()->getContentType() ?></td>
            </tr>
            <tr>
                <th><label>Publicada:</label></th>
                <td>
                    <?php if($section->getPublished()): ?>
                        <img alt="Sí" src="/images/util/check.png"/>
                    <?php else: ?>
                        <img alt="No" src="/images/util/cross.png"/>
                    <?php endif; ?>
                </td>
            </tr>
            <tr>
                <th><label>Ultima modificación:</label></th>
                <td><?php echo $section->getUpdatedAt()?></td>
            </tr>
        </tbody>
    </table>
</div>